﻿<%@ Page Language="C#" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Collections" %>
<%@ Import Namespace="System.Collections.Generic" %>
<%@ Import Namespace="TarreOA.TarreOABLL" %>
<%@ Import Namespace="TarreOA.TarreOAModels  " %>
<script runat="server">

    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            //this.hlkMyGroup.Attributes.Add("onclick", "TableStyle('myGroup')");
            //this.hlkFoundUser.Attributes.Add("onclick", "TableStyle('myFound')"); 
        }
        this.DataList_DataTable();
    }

    protected void DataList_DataTable()
    {
        User curLoginUser = (User)Session["user"];
        UserCommunicationGrouptbService ucgs = new UserCommunicationGrouptbService();
        List<UserCommunicationGrouptb> list = ucgs.findByUserLoginName(curLoginUser.LoginName);
        if (list != null && list.Count > 0)
        {
            DataSet ds = new DataSet();
            DataTable dt = new DataTable();
            dt.Columns.Add("ComGroupName", typeof(string));
            dt.Columns.Add("ComGroupId", typeof(string));
            foreach (UserCommunicationGrouptb userCommunicationGrouptb in list)
            {
                DataRow dr = dt.NewRow();
                dr["ComGroupName"] = userCommunicationGrouptb.ComGroupName;
                dr["ComGroupId"] = userCommunicationGrouptb.ComGroupId.ToString();
                dt.Rows.Add(dr);
            }
            ds.Tables.Add(dt);
            this.DataList1.DataSource = ds.Tables[0].DefaultView;
            this.DataList1.DataBind();
        }
    }

    protected void DataList1_ItemDataBound(object sender, RepeaterItemEventArgs e)
    {
        if (e.Item.ItemType == ListItemType.AlternatingItem || e.Item.ItemType == ListItemType.Item)
        {
            string cgid = ((HtmlInputHidden)e.Item.FindControl("hidComGroupId")).Value;
            ((HyperLink)e.Item.FindControl("hlkComGroup")).NavigateUrl = "CommunicationGroupLinkManShow.aspx?cgid=" + cgid;
        }
    }
</script>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>无标题页</title>
    <script type="text/javascript" language="javascript" src="../../js/UserCommunication.js"></script>
    <link rel="Stylesheet" type="text/css" href="../../Styles/right_style.css" />
    <script type="text/javascript" src="../../Scripts/jquery.ui/js/jquery.js"></script>
    <script type="text/javascript">
        $(function () {
            $("#tab1").click(function () {
                $("#spread").slideToggle();
            });

            $("#tab2").click(function () {
                $("#spread1").slideToggle();
            });
        });
    </script>
    <style type="text/css">
<!--
html{ scrollbar-base-color: #dbecf8; scrollbar-arrow-color: #2a8ed1; scrollbar-track-color: #bdddf2; scrollbar-3dlight-color: #2886c5; scrollbar-darkshadow-color: #2886c5;
scrollbar-face-color: #dbecf8; scrollbar-shadow-color: #dbecf8;  }
-->
</style>
</head>
<body>
    <form id="form1" runat="server">
        <div class="sub_right_top">
        <div class="hdm_footer">
            <div class="add_book_left">
                <div class="add_book_cont">
                    <ul>
                        <li id="narrowed">
                            <div class="add_book_my" id="tab1">
                                <span class="add_book_title">我的通讯组</span></div>
                            <ul id="spread" class="add_book_border">
                                <asp:Repeater ID="DataList1" runat="server" OnItemDataBound="DataList1_ItemDataBound">
                                    <ItemTemplate>
                                        <li class="add_book_list">
                                            <asp:HyperLink ID="hlkComGroup" runat="server" Font-Underline="False" Target="mainFrame"
                                                Text=''><span class="add_span_spc"><%# Eval("ComGroupName") %></span></asp:HyperLink>
                                            <input id="hidComGroupId" type="hidden" runat="server" value='<%# Eval("ComGroupId") %>' />
                                        </li>
                                    </ItemTemplate>
                                </asp:Repeater>
                            </ul>
                        </li>
                        <li id="narrowed1">
                            <div class="add_book_reasch" id="tab2">
                                <span class="add_book_title1">查找联系人</span></div>
                            <ul id="spread1" class="add_book_border">
                                <li class="add_book_list">
                                    <asp:HyperLink ID="HyperLink4" runat="server" Font-Underline="False" NavigateUrl="~/User/UserCommunication/UserFindLinkManByName.aspx"
                                        Target="mainFrame"><span class="add_span_spc">按姓名查找(关键字)</span></asp:HyperLink>
                                </li>
                                <li class="add_book_list">
                                    <asp:HyperLink ID="HyperLink5" runat="server" Font-Underline="False" NavigateUrl="~/User/UserCommunication/UserFindLinkManByBirthday.aspx"
                                        Target="mainFrame"><span class="add_span_spc">按生日查找(范围)</span></asp:HyperLink>
                                </li>
                                <li class="add_book_list">
                                    <asp:HyperLink ID="HyperLink1" runat="server" Font-Underline="False" NavigateUrl="~/User/UserCommunication/UserFindLinkManByUnitName.aspx"
                                        Target="mainFrame"><span class="add_span_spc">按单位查找(关键字)</span></asp:HyperLink>
                                </li>
                            </ul>
                        </li>
                        <li class="add_book_manage"><a href="ComGroupManager.aspx" target="mainFrame"><span
                            class="add_book_title">管理分组</span></a></li>
                    </ul>
                </div>
            </div>
            <div class="add_book_right">
            </div>
            <div class="clear">
            </div>
            <div style="height: 15px; overflow: hidden;">
            </div>
        </div>
    </div>
    </form>
</body>
</html>
